package com.alpha.bom;

import java.util.ArrayList;

/**
 * This class is used to create the real exam to be taken by the student.
 * 
 * @author Catherine C. Graza
 * @version 1.0
 * @since JDK1.7
 */
public class RealExam extends Exam{

	private boolean locked;
	private int numberOfStudents;
	
	/**
	 * This is used to construct the instance of the real exam
	 * @param examId the integer value of the exam id
	 */
	public RealExam(int examId) {
		super();
		this.locked = true;
		this.setExamId(examId);
		this.setExamType("Real");
		this.setQuestions(new ArrayList<Question>());
	}	
	
	/**
	 * This is used to construct the instance of the real exam
	 * @param examId the integer value of the exam id
	 * @param examName the String name of the exam
	 */
	public RealExam(int examId, String examName) {
		super();
		this.setExamId(examId);
		this.setExamName(examName);
		this.setExamType("Real");
		this.setQuestions(new ArrayList<Question>());
		this.locked = true;
		this.setNumberOfStudents(0);
	}
	
	/**
	 * This is used to construct the instance of the real exam
	 * @param examId id of the exam
	 * @param examName name of the exam
	 * @param professorId the id of the professor
	 */
	public RealExam(int examId, String examName, int professorId){
		super();
		this.setExamId(examId);
		this.setExamName(examName);
		this.setExamType("Real");
		this.setQuestions(new ArrayList<Question>());
		this.setProfessorId(professorId);
		this.locked = true;
		this.setNumberOfStudents(0);
	}
	
	/**
	 * This is used to construct the instance of the real exam
	 * @param examId id of the exam
	 * @param examName name of the exam
	 * @param professorId the id of the professor
	 * @param numOfStudent the number of students who takes this exam
	 */
	public RealExam(int examId, String examName, int professorId, int numOfStudent){
		super();
		this.setExamId(examId);
		this.setExamName(examName);
		this.setExamType("Real");
		this.setQuestions(new ArrayList<Question>());
		this.setProfessorId(professorId);
		this.locked = true;
		this.setNumberOfStudents(numOfStudent);
	}

	/**
	 * This is used to retrieve whether the exam is locked or not
	 * @return boolean
	 * true, if the exam is locked
	 * false, if the exam is not locked
	 */
	public boolean isLocked() {
		return locked;
	}

	/**
	 * This is used to change the locked value
	 * @param locked
	 * true, if the exam is locked
	 * false, if the exam is not locked
	 */
	public void setLocked(boolean locked) {
		this.locked = locked;
	}

	/**
	 * This sets the number of students who are given this exam
	 * @param numberOfStudents the numberOfStudents to set
	 */
	public void setNumberOfStudents(int numberOfStudents) {
		this.numberOfStudents = numberOfStudents;
	}

	/**
	 * This returns the number of students who are given this exam
	 * @return the numberOfStudents
	 */
	public int getNumberOfStudents() {
		return numberOfStudents;
	}
}
